home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 7020 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  3.8 KB

  1. Path: news.infi.net!usenet
  2. From: nngis@norfolk.infi.net (Greg DiGiorgio)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Which C compiler?
  5. Date: 17 Feb 1996 13:48:37 GMT
  6. Organization: Customer of InfiNet
  7. Distribution: world
  8. Message-ID: <4g4mbl$n5t@nw002.infi.net>
  9. References: <56c21b5c56c21b5c@iconet.hongkong.net>
  10. NNTP-Posting-Host: h-werewolf.norfolk.infi.net
  11. Mime-Version: 1.0
  12. X-Newsreader: WinVN 0.99.3
  13.  
  14. In article <56c21b5c56c21b5c@iconet.hongkong.net>, 
  15. wong.yuk.wah%f18.n1000.z128@iconet.hongkong.net says...
  16. >
  17. >Hi!
  18. >
  19. >I'm a beginner in C programming. Just having learnt the basic concept of 
  20. C,
  21. >I found I still couldn't write a *real* program. The ANSI standard 
  22. doesn't
  23. >provide the variety of functions that a usual program needs, such as 
  24. text
  25. >color, graphics, and that kind of interface stuff.
  26.  
  27. That is true, very true. And for reasons like that, you must step outside 
  28. of the ANSI standard. But the idea of the ANSI std is not to make 'C' 
  29. 100% portable, but to simply make a good portion of the code 
  30. platform-independent. For example, assume you write 'C' programs for 
  31. Windows, invoking the Windows API and you want to port to UNIX X-windows. 
  32. Much of your "user-interface" code will have to be rewritten to run on 
  33. X-windows (or you must have a tool that knows how to xlat Windows API 
  34. calls to X-windows). But the brainy part of your code - where you do 
  35. calculations and the like - will probably be portable if you stick with 
  36. standard 'C' library functions.
  37.  
  38. >
  39. >So I'm facing a problem. The fact is that I'm using Turbo C++ 3.00 for
  40. >learning purpose. There's lots of libraries helping achieve the desired
  41. >effects, such as BGI. But BGI certainly won't be included in Microsoft 
  42. >C/C++ (not mentioning Visual C++ that I *cannot* use!). So I think
  43. >switching from a C implementation to another is rather difficult. But 
  44. what
  45. >implementation should I choose? There are so many different versions of
  46. >C/C++, like Borland, Turbo, Microsoft, Symantec, and so on. After I've
  47. >made my choice, I want to stick to it. But the problem is which one I
  48. >should choose.
  49.  
  50. It depends... First, you must decide which platforms 
  51. (DOS/OS2/Windows/UNIX) you want to develop for? Once you've done that, 
  52. then pick the compiler that provides for most target systems. Beware that 
  53. once you've done that, you are locked into that compiler for the 
  54. system-dependent code. The upside is that multi-platform compilers allow 
  55. you to have one set of source code that runs on more than one OS. 
  56.  
  57. As for sticking with just one compiler, here's an example of why you 
  58. might not want to do that: I wrote a DOS-based 'C' screen painter/code 
  59. generator. I wrote all the platform-dependent code in assembler (gotoxy, 
  60. kbhit, textcolor, textbackgorund, mouse functions, etc). That allowed me 
  61. to have compiler independence, at least in DOS. As such, I compiled my 
  62. 'C' libraries in Turbo-C, Turbo-C/C++ (all versions), Borland C/C++ (all 
  63. versions), and MS-C V6.0. Doing so, allowed me to target the big DOS 
  64. compilers (at that time) to have the widest possible audience for my 
  65. package. If I had become dependent on say, Turbo-C only, my potential 
  66. customer base would have been much smaller.
  67.  
  68. >
  69. >Can anyone tell me what is more suitable? By the way, I learnt from 
  70. books
  71. >that C is famous for its portability. How's the portability differs 
  72. among
  73. >the various versions? Thanks a lot!
  74.  
  75. For DOS only, I'd use Turbo-C/C++. For DOS & Windows, I'd prefer Borland. 
  76. For Windows only, I'd use MS-VC/C++ 4.0, For other platforms, there is a 
  77. single mfr that makes a C/C++ compiler that goes against most everything, 
  78. but I can't remember the name - even though we have it at work. The mfr 
  79. name is about as recognizable (or non-recognizable) as Symantec.
  80.  
  81.  
  82. >
  83. >Regards,
  84. >Wong Yuk Wah
  85. >
  86. >* Origin: IcoNET <--> Internet/Usenet gateway, 128:1000/1 (128:1000/1)
  87.  
  88. Hope this helps,
  89. Greg DiGiorgio
  90.  
  91.